/**
 * Copyright 2014-2019 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.webank.fiscobcoscanal2.db.entity;

import java.math.BigInteger;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.UpdateTimestamp;

import com.fasterxml.jackson.annotation.JsonInclude;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * TransactionInfo
 *
 * @Description: TransactionInfo
 * @author maojiayu
 * @data Oct 29, 2019 4:31:23 PM
 *
 */
@Data
@Accessors(chain = true)
@Entity(name = "transaction_info")
@Table(name = "transaction_info", indexes = { @Index(name = "block_height", columnList = "block_height") })
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TransactionInfo extends IdEntity {

    private static final long serialVersionUID = 5416582514143902267L;

    /** @Fields blockHeight : block height */
    @Column(name = "block_height", columnDefinition = "bigint")
    private BigInteger blockHeight;

    @Column(name = "index_number")
    private int indexNumber;

    @Column(name = "from_address")
    private String from;

    @Column(name = "to_address")
    private String to;

    @Column(columnDefinition = "text")
    private String data;

    private String value;

    /** @Fields updatetime : depot update time */
    @UpdateTimestamp
    @Column(name = "depot_updatetime")
    @Temporal(TemporalType.TIMESTAMP)
    protected Date depotUpdatetime;

    private int status = 0;
}
